package com.food.controller;

import com.food.common.Result;
import com.food.model.dashboard.DashboardResponse;
import com.food.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class HomeController {
    
    @Autowired
    private DashboardService dashboardService;
    
    @GetMapping("/dashboard")
    public Result<DashboardResponse> getDashboard(@RequestParam Integer userId) {
        DashboardResponse response = dashboardService.getDashboardData(userId);
        return Result.success(response);
    }
} 